﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.DAL;
using GtsServer.Model;
using System.Data;
using GtsServer.Common;

namespace GtsServer.Manage.Controller
{
    public class ClassModeController
    {
        NoticeDAL dal = new NoticeDAL();
        public List<NoticeShow> GetList(string str = "")
        {
            List<NoticeShow> list = new List<NoticeShow>();
            str = "taskID=0 and (TypeID=" + Convert.ToInt32(EnumNoticeType.经典模式公告) + " or TypeID=" + Convert.ToInt32(EnumNoticeType.彩池公告) + ")";
            DataSet ds = dal.GetList(str);
            list = IListDataSet.DataSetToIList<NoticeShow>(ds, 0).ToList();
            return list;
        }
        public int Add(Notice models)
        {
            return dal.Add(models);
        }
        public bool Update(Notice model)
        {
            return dal.UpdateClass(model);
        }
        public bool Delete(int ID)
        {
            return dal.Delete(ID);
        }

        public bool AddHandNotice(int dynameicType, string userAccount, string prizeName, int prizeNum, int prizePrice)
        {
            return dal.AddHandNotice(dynameicType, userAccount, prizeName, prizeNum, prizePrice);
        }
    }
}
